/*******************************************************************************
 * @brief: 程序参数
 * @Author:   aple
 * @Date: 2020-09-02 23:35:00
 * @LastEditors: aple
 * @LastEditTime: 2022-11-12 10:14:58
 * @Verision: 1.0.0.0
 ******************************************************************************/
#ifndef PROGTAB_H_H_
#define PROGTAB_H_H_

#ifdef _PROG_MODULE_
#define MY_EXT
#else
#define MY_EXT extern
#endif

#include "mytype.h"
#include "appcfg.h"
#include "par_tab.h"
#include "prog_seg.h"

#ifdef __cplusplus
extern "C"
{
#endif

	typedef struct
	{
		int16_t time; //负数代表结束，0跳过，其余数据代表有效段
		int16_t temp;
		int16_t out_limit;
	} prog_tab_type;

	MY_EXT prog_tab_type prog_tab[PROG_SEG_MAX + 2];
	extern const prog_manage_type prog_obj;

	void prog_val_set(uint8_t seg, uint16_t par_num, int32_t ival);
	int32_t prog_val_get(uint8_t seg, uint16_t par_num);

#define prog_par_pos(index, par) ((uu32)(&((prog_tab_type *)0)[index].par) / 2)
#define prog_par_tab(list_index) ((u16_tt *)(&prog_tab[list_index]))

#ifdef __cplusplus
}
#endif

#undef MY_EXT

#endif /* PROGTAB_H_H_ */
